/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package hojano6;

/**
 *
 * @author Andrea Magaly Mendoza, 11331
 */
public abstract class AbstractBinaryTree <E extends Comparable<E>> implements BinaryTree <E>{
  
    
    //------------------------------------------------------------------------
    // Constructor:
    //------------------------------------------------------------------------
    
    /**
     * pre: -
     * post: -
     */
    public AbstractBinaryTree(){}

    //------------------------------------------------------------------------
    // MÃ©todos:
    //------------------------------------------------------------------------
    
    /**
     * Regresa la referencia de la raiz del Ã¡rbol.
     * @pre: -
     * @post: Regresa la raiz.
     */
    @Override
     public BinaryTree root(){
         if (parent() == null){
             return this;
         }
         else{
             return parent().root();
         }
     }

}
